Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
The unixify npm package is a utility that converts Windows-style file paths to Unix-style file paths. It is a simple and lightweight package that can be used to ensure file paths are compatible with Unix-based systems, which is particularly useful when working with tools or codebases that are expected to run across different operating systems.
Convert Windows paths to Unix paths
This feature allows you to convert a Windows file path to a Unix file path by replacing backslashes with forward slashes and removing any drive letters.
const unixify = require('unixify');
const unixPath = unixify('C:\\Users\\Example\\file.txt');
console.log(unixPath); // Output: '/Users/Example/file.txt'
The 'slash' package is similar to unixify in that it converts Windows backslash paths to Unix slash paths. Unlike unixify, it does not remove drive letters from the paths, making it a bit less aggressive in its conversion.
The 'upath' package extends the native path module to work seamlessly on both Windows and Unix systems. It normalizes the paths and provides consistent results on both platforms. It offers more comprehensive functionality compared to unixify, including not only path normalization but also other path manipulation utilities.
Convert Windows file paths to Unix-like paths (
/
)
npm i unixify --save
var unixify = require('unixify');
unixify('one\\two\\three');
//=> 'one/two/three'
unixify('F:\\one\\two\\three');
//=> '/one/two/three'
unixify('F:\\//one\\two\\three');
//=> '//one/two/three'
unixify('F:\\//one\\two\\three');
//=> '//one/two/three'
unixify('one\\two\\//three');
//=> 'one/two/three'
unixify('C:\\//one\\two\\//three');
//=> '//one/two/three'
Install dev dependencies:
node i -d && mocha
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on December 22, 2014.
FAQs
Convert Windows file paths to unix paths.
We found that unixify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.